package seven.test_7_9;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class TestMain3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        PriorityQueue<Integer> maxHeap = new PriorityQueue<Integer>(new Comparator<Integer>(){
            @Override
            public int compare(Integer i1,Integer i2){
                return i2-i1;
            }
        });
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        ArrayList<Integer> arrayList = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int tmp = scanner.nextInt();
            if(tmp % 2 == 0) {
                maxHeap.add(tmp);
            } else {
                arrayList.add(tmp);
            }
        }
        while (k > 0 && maxHeap.size() > 0) {
            int tmp = maxHeap.poll();
            tmp = tmp / 2;
            k--;
            if(tmp % 2 == 0) {
                maxHeap.add(tmp);
            } else {
                arrayList.add(tmp);
            }
        }
        int count = 0;
        while (maxHeap.size() > 0) {
            count += maxHeap.poll();
        }
        for (int i = 0; i < arrayList.size(); i++) {
            count += arrayList.get(i);
        }
        System.out.println(count);
    }
}
